Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage diffractometer constraints #308

Merged
merged 4 commits into from
Feb 26, 2020
Merged

manage diffractometer constraints #308

merged 4 commits into from
Feb 26, 2020

Conversation

prjemian
Copy link
Contributor

fixes #307

@prjemian prjemian added this to the 1.2.2 milestone Feb 26, 2020
@prjemian prjemian self-assigned this Feb 26, 2020
@prjemian
Copy link
Contributor Author

Unit tests should be possible using calc mode with simulated motors. Here's the setup:

from ophyd import Component
from ophyd import PseudoSingle
from ophyd import SoftPositioner

from apstools.diffractometer import DiffractometerMixin

class FourCircleDiffractometer(DiffractometerMixin, E4CV):
    h = Component(PseudoSingle, '', labels=("hkl", "fourc"))
    k = Component(PseudoSingle, '', labels=("hkl", "fourc"))
    l = Component(PseudoSingle, '', labels=("hkl", "fourc"))

    omega = Component(SoftPositioner, labels=("motor", "fourc"))
    chi   = Component(SoftPositioner, labels=("motor", "fourc"))
    phi   = Component(SoftPositioner, labels=("motor", "fourc"))
    tth   = Component(SoftPositioner, labels=("motor", "fourc"))

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # since this diffractometer uses simulated motors,
        # prime the SoftPositioners (motors) with initial values
        # otherwise, position == None --> describe, etc gets borked
        for axis in (self.omega, self.phi, self.chi, self.tth):
            axis.move(0)


fourc = FourCircleDiffractometer('', name='fourc', labels=("diffractometer", "fourc"))

@prjemian prjemian merged commit 23373f5 into master Feb 26, 2020
@prjemian prjemian deleted the 307-diffractometer branch February 26, 2020 16:54
prjemian added a commit that referenced this pull request Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add diffractometer enhancements
1 participant